The present invention relates generally to the data processing field, and, more particularly, relates to promoting efficient operation of a hard disk drive.
In a hard disk drive, data signals are read from and written to a rotating disk by a head which is moved substantially radially with respect to the disk. FIG. 1 is a simplified block diagram that illustrates conventional circuitry which controls the positioning of a head in a disk drive. Signal conditioning and reading circuitry 10 receives an input signal from arm electronics, which are not shown. A signal output from the signal conditioning and reading circuitry 10 is provided to a head control circuit 12. The head control circuit 12 processes the signal received from the signal conditioning and reading circuitry 10 and outputs a control signal to an actuator drive circuit 14. The actuator drive circuit 14 provides a driving signal to a head actuator motor (not shown) which typically is a voice coil motor.
The head control circuit 12 also receives commands from a host system, which is not shown. The head control circuit 12 includes a processing capability 16, which may include one or more processors. Also included in the head control circuit 12 are one or more memory units, represented by memory block 18 in FIG. 1.
The head control circuit 12 responds to commands from the host by moving the head from a current position to a target position. Such operations are referred to as xe2x80x9cseeksxe2x80x9d, and are intended to bring the head into a stable position at a target track or cylinder.
According to conventional practices, commands from the host may be queued in the head control circuit 12, and may be selected from the queue for execution in accordance with a process intended to minimize the average access time for execution of commands. According to a known command queue ordering technique, a Shortest Access Time First (SATF) algorithm is employed. According to this algorithm, the command selected for execution from the command queue is that which can be started first. Estimated access times for commands are contained in a seek profile table stored in the memory 18. The estimated access times indicated by the seek profile table take two factors into account: (a) the time required to seek to and settle at the target track, and (b) the additional time required for the disk to rotate so that the target sector reaches the locus of the head. This additional rotational time is sometimes referred to as xe2x80x9cextra latencyxe2x80x9d.
When a command fails to be executed within the estimated access time indicated by the seek profile table, execution of the command must await an additional rotation of the disk. This phenomenon can degrade the performance of the disk drive, and is referred to as a xe2x80x9cmissxe2x80x9d.
FIG. 2 is a time line that illustrates a sequence of events which may occur in connection with a conventional manner of operating a hard disk drive. It should be noted that the time line of FIG. 2 indicates event sequence only, and is not drawn to scale. As indicated at 20 in FIG. 2, the disk drive sends a status message to the host system to indicate completion of execution of an access command (i.e., a read or a write). Then the disk drive begins execution of the next access command, by starting a seek operation, as indicated at 22. During the seek operation a new command is received at the disk drive from the host system, as indicated at 24. The new access command is added to the command queue, and the head control circuit 12 (FIG. 1) proceeds to sort the command queue, as indicated at 26, to determine which command in the queue will have the shortest access time upon completion of the execution of the command which is currently in progress. The command in the command queue which is determined to have the shortest access time is selected to be the next command to be executed after the currently executing command.
After the command queue sorting has occurred in background during the seek operation, the seek operation ends, as indicated at 28. That is, the read/write head has reached and settled on the target track. The head then remains positioned at the target track while waiting for the disk to rotate to bring the target sector to the locus of the head. This period of waiting may be referred to as xe2x80x9con-track timexe2x80x9d and is indicated at 30. When the target sector arrives at the head, the xe2x80x9cdata phasexe2x80x9d (indicated at 32) occurs. That is, reading of data from the disk or writing of data to the disk takes place. Upon completion of the read or write, the disk drive sends a status message (indicated at 34) to the host system. The cycle of operation is then repeated with respect to the next access command to be executed, which was selected during the command queue sorting operation indicated at 26.
There may be a number of variations in the conventional sequence of events illustrated in FIG. 2. For example, no new command may arrive prior to the command queue sort operation. Alternatively, the command queue sort operation may occur immediately after the seek start 22, then a new command may arrive, and the command queue sort operation may be performed again to determine whether the newly arrived command has a shorter access time than the command selected at the initial sort operation. Arrival of a new command and resorting of the command queue may occur at any time during the period from seek start to completion of command execution (completion of the data phase). More than one new command may be received during this period, and consequently more than one re-sort of the command queue may occur during this period.
The conventional SATF sort operation referred to in connection with FIG. 2 may be modified according to an invention that is commonly assigned herewith and referred to as DEAT (Delta Expected Access Time). The DEAT SATF algorithm is disclosed in co-pending commonly-assigned patent application Ser. No. 09/638,253, filed Aug. 14, 2000 (Attorney Docket Number ROC9-2000-0161-US1). This co-pending patent application is incorporated herein by reference.
In selecting a command for execution from the command queue, the DEAT SATF algorithm considers not only the estimated access time indicated by the seek profile table, but also the probability that the command will be executed within the estimated time. The probability information may be based on actual experience in executing commands, as indicated by a probability table. An example of a probability table provided according to the DEAT SATF algorithm is shown in FIG. 3. The probability table of FIG. 3 indicates execution experience for executed commands that have been categorized according to seek distance and estimated extra latency. The seek distance is measured in terms of cylinder groups, and the estimated extra latency is measured in terms of servo ID""s. For each category of commands, the corresponding data cell indicates the xe2x80x9cmiss ratexe2x80x9d, i.e. the percentage of executed commands in the category that have resulted in xe2x80x9cmissesxe2x80x9d. The execution experience data provided in a miss rate table like FIG. 3 may be used in accordance with the DEAT SATF algorithm to provide a modified estimated access time for each command in the command queue, thereby leading to improved selection of the next command for execution, by reducing the likelihood that a miss will occur during the execution of the selected command.
The present inventors have recognized that the extra latency or xe2x80x9con-track timexe2x80x9d represented at 30 in the time line of FIG. 2 may present an opportunity for still further improvements in the efficiency of operation of a disk drive.
According to a first aspect of the invention, a method of operating a disk drive is provided. The inventive method according to this aspect of the invention includes maintaining a command queue that includes a plurality of access commands that are awaiting execution, and sorting the command queue to provisionally select one of the plurality of access commands as a next command to be executed. The inventive method according to this aspect of this invention further includes calculating a seek start deadline for the provisionally selected access command based on an estimated extra latency of the provisionally selected access command. The seek operation is then deferred with respect to the provisionally selected access command based on an outcome of the calculating step, to await arrival at the disk drive of a new access command. If a new access command arrives at the disk drive prior to the seek start deadline, the respective access times for the provisionally selected access command and the newly arrived access command are compared to select one of the two access commands for execution, and the selected one of the two access commands is executed. If no new access command arrives at the disk drive prior to the seek start deadline, then the provisionally selected access command is executed.
In at least one embodiment, the sorting step may be performed in accordance with an SATF algorithm. The SATF algorithm may be a DEAT SATF algorithm, i.e., one which takes into account estimated probabilities that the access commands in the command queue can be performed within estimated access times. Such a DEAT SATF algorithm may use, for example, a table of estimated probabilities that categories of access commands can be performed within estimated access times, the table having a first axis corresponding to cylinder groups and a second axis corresponding to estimated extra latencies. In one or more embodiments, the calculating step may be based on estimated probability values stored in the table. The calculating step may include examining adjacent probability values for a cylinder group to which the provisionally selected access command belongs, to determine whether deferring the seek operation with respect to the provisionally selected access command is likely to decrease a probability that the provisionally selected access command can be performed within an estimated access time.
According to a second aspect of the invention, a method of operating a disk drive is provided. The method in accordance with this aspect of the invention includes maintaining a command queue that includes a plurality of access commands that are awaiting execution, and sorting the command queue to provisionally select one of the plurality of access commands as a next command to be executed. The method according to this aspect of the invention further includes determining whether to defer execution of the provisionally selected access command based on an estimated extra latency of the provisionally selected access command. If it is determined not to defer execution of the provisionally selected access command, the provisionally selected access command is executed upon completion of execution of a previous access command. If it is determined to defer execution of the provisionally selected access command, a seek start deadline for the provisionally selected access command is calculated, and execution of the provisionally selected access command is deferred to await, until the seek start deadline, arrival at the disk drive of a new access command.
According to a third aspect of the invention, a method of operating a disk drive is provided. The method according to this aspect of the invention includes maintaining a command queue that includes a plurality of access commands that are awaiting execution, and sorting the command queue to provisionally select one of the plurality of access commands as a next command to be executed. The method in accordance with this aspect of the invention further includes calculating a seek start deadline for the provisionally selected access command based on an estimated extra latency of the provisionally selected access command. Also included in the method according to this aspect of the invention is deferring a seek operation with respect to the provisionally selected access command based on an outcome of the calculating step, to await arrival at the disk drive of a new access command. If no new access command arrives at the disk drive prior to the seek start deadline, the provisionally selected access command is executed. If a new access command arrives at the disk drive prior to the seek start deadline, it is determined which one of the provisionally selected access command and the newly arrived access command has a shorter estimated access time. If the newly arrived access command is determined to have a shorter estimated access time, it is determined whether to defer execution of the newly arrived access command based on an estimated extra latency of the newly arrived access command. If the provisionally selected access command is determined to have a shorter estimated access time, the method according to this aspect of the invention continues to defer the seek operation with respect to the provisionally selected access command to await, until the seek start deadline, arrival at the disk drive of another new access command.
In at least one embodiment, the determination as to which one of the provisionally selected access command and the newly arrived access command has a shorter estimated access time may take into account estimated probabilities that the provisionally selected access command and the newly arrived access command can be performed within respective estimated access times.
According to a further aspect of the invention, an apparatus for controlling a head actuator in a disk drive is provided. The apparatus includes a head control circuit programmed to perform one or more of the above-described methods.
The present invention takes advantage of the extra latency anticipated to occur in an access command that has been selected for execution pursuant to an SATF algorithm. Based on the expected extra latency, the beginning of the execution of the selected command can be deferred in order to await possible arrival of a new access command which may have a shorter estimated access time than the selected command. The deferral of the execution of the selected command may continue up until a deadline that has been set based on the anticipated extra latency for the selected command. If a new command is received prior to the deadline, the deferral of execution of the selected command has the effect of increasing the queue depth by one command. This may well lead to more efficient operation.
The present invention may provide particularly good results in a case where a number of threads executing at the host system each enqueue only a single access command at a time to the command queue. In this situation, each of the threads may wait to send the next access command for the thread upon receipt of a status message indicating execution of the access command that the thread had previously sent to the disk drive. The next command sent by the thread may be sequential or nearly sequential in operation of the disk drive to the command that was just executed by the disk drive for the thread. Consequently, in the situation where single commands are enqueued at any one time from each thread, the present invention may reduce jumping from thread to thread, and facilitate execution of a number of commands for a single thread in sequence. This is likely to result in greatly increased efficiency in operating the disk drive.
Other objects, features and advantages of the present invention will become more fully apparent from the following detailed description of exemplary embodiments, the appended claims and the accompanying drawings.